<template>
	<view @click="toInformation" class="bg-white flex-row"
		style="height: 50px;width: 100%;margin-top: 10px;justify-content: space-between;">
		<view style="height: 100%;display: flex;align-items: center;margin-left: 15px;">
			姓名
		</view>
		<view style="margin: 15px;">
			{{formData.name}}
		</view>
	</view>
	<view class="bg-white flex-row" style="width: 100%;margin-top: 2px;justify-content: space-between;">
		<view style="display: flex;align-items: center;margin-left: 15px; width: 30%; ">
			队伍
		</view>
		<view style="margin: 15px;">
			<view v-for="item in formData.teamId">
				{{item.teamName}}
			</view>
		</view>
	</view>
	<view class="bg-white flex-row" style="height: 50px;width: 100%;margin-top: 2px;justify-content: space-between;">
		<view style="height: 100%;display: flex;align-items: center;margin-left: 15px;">
			性别
		</view>
		<view style="margin: 15px;">
			{{formData.landscape === 0?"男":formData.landscape === 1?"女":''}}
		</view>
	</view>
	<view class="bg-white flex-row" style="height: 50px;width: 100%;margin-top: 2px;justify-content: space-between;">
		<view style="height: 100%;display: flex;align-items: center;margin-left: 15px;">
			加入时间
		</view>
		<view style="margin: 15px;">
			{{formData.workstate}}
		</view>
	</view>
	<view class="bg-white flex-row" style="height: 50px;width: 100%;margin-top: 2px;justify-content: space-between;">
		<view style="height: 100%;display: flex;align-items: center;margin-left: 15px;">
			所在单位
		</view>
		<view style="margin: 15px;">
			{{formData.sex}}
		</view>
	</view>
	<view @click="toInformation" class="bg-white flex-row"
		style="height: 50px;width: 100%;margin-top: 2px;justify-content: space-between;">
		<view style="height: 100%;display: flex;align-items: center;margin-left: 15px;">
			特长
		</view>
		<view style="margin: 15px;" v-if="formData.forte!=null">
			{{formData.forte.length>8?formData.forte.slice(0,8):formData.forte}}
		</view>
	</view>
	<view @click="toInformation" class="bg-white flex-row"
		style="height: 50px;width: 100%;margin-top: 2px;justify-content: space-between;">
		<view style="height: 100%;display: flex;align-items: center;margin-left: 15px;">
			政治面貌
		</view>
		<view style="margin: 15px;">
			{{formData.Contactaddress}}
		</view>
	</view>
	<view @click="toInformation" class="bg-white flex-row"
		style="height: 50px;width: 100%;margin-top: 2px;justify-content: space-between;">
		<view style="height: 100%;display: flex;align-items: center;margin-left: 15px;">
			联系地址
		</view>
		<view style="margin: 15px;">
			{{formData.illustrate}}
		</view>
	</view>
	<view class="bg-white flex-row" style="height: 50px;width: 100%;margin-top: 10px;justify-content: space-between;">
		<view @click="onLogin"
			style="height: 100%;display: flex;align-items: center;justify-content: center;width: 100%;color: red;">
			退出登录
		</view>
	</view>
</template>

<script setup lang="ts">
	import { ref, reactive } from 'vue';
	import { onLoad } from "@dcloudio/uni-app"
	import { userinfo } from '../../api/myhome/login';
	let form = reactive({
		value: {
			nickName: '未登陆',
			text: '这个人很懒，什么都没说',
			integral: 1299,
			time: '2024-4-23',
			workhours: 568,
			role: 0,
			realNameAuthenticated: 0
		}
	});

	const formData = reactive({
		name: '',
		phone: '',
		workstate: '',
		Contactaddress: '',
		illustrate: '',
		landscape: '',
		teamId: [],
		age: '',
		sex: '',
		forte: '',
		workHour: ''
	});
	//运营商
	const service_name = ref('')

	const picker = ref(null)

	onLoad(() => {
		userinfo().then(res => {
			formData.name = res.data.realName
			formData.phone = res.data.team
			formData.teamId = res.data.teamList
			formData.workstate = res.data.joinDatetime
			formData.Contactaddress = res.data.politicalIdentity
			formData.illustrate = res.data.contactAddress
			formData.landscape = res.data.sex
			formData.forte = res.data.forte
			formData.sex = res.data.company
			console.log("11111111")
		})
	})
	const toInformation = () => {
		uni.navigateTo({
			url: '/pages/me/informationMe'
		})
	}
	const onLogin = () => {
		uni.removeStorageSync('token')
		uni.redirectTo({
			url: '/pages/login/login'
		})
	}
</script>

<style>
	page {
		background-color: #EFEFEF;
	}
</style>